From 8a1bb4d3520c773ed7e35fa0c5bcbd6dda18131c Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 20 Jan 2008 23:32:54 +0000 Subject: [PATCH] Don't loop infinitely on invalid saroute files. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3062 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/saroute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpsbabel/saroute.c b/gpsbabel/saroute.c index b18261c21..e7844fbce 100644 --- a/gpsbabel/saroute.c +++ b/gpsbabel/saroute.c @@ -80,7 +80,7 @@ ReadRecord(FILE * f, { unsigned char *result = (unsigned char *) xmalloc(size); - if (!fread(result, size, 1, f)) + if (size && !fread(result, size, 1, f)) fatal(MYNAME ": Attempt to read past EOF"); return result; } -- 2.30.2